<?
	function openMetadataDB ( $cPathModule = 'documentacion')
	{
		return openDB( DB_SQLITE, $cPathModule . "/db/metadata.sdb" ) ;
	}
	function initializeModulo( &$oInput )
	{
		global $aInstallModules;
		foreach ( $aInstallModules as $cKey => $aInstallModule )
		{
			if ( file_exists( $aInstallModule['cPathModule'] . "/db/metadata.sdb" )  ) $oInput->addOption( $aInstallModule['cPathModule'], $cKey);
		}
	}
	function initializeTabModulo( &$oTab )
	{
		global $aInstallModules;
		foreach ( $aInstallModules as $cKey => $aInstallModule )
		{
			if ( file_exists( $aInstallModule['cPathModule'] . "/db/metadata.sdb" )  ) $oTab->addTab( $cKey, $aInstallModule['cPathModule']);
		}
	}
	function initializeTabModuloDB( &$oTab )
	{
		global $aInstallModules;
		foreach ( $aInstallModules as $cKey => $aInstallModule )
		{
			$cFileDB = $aInstallModule['cPathModule'] . "/db/$cKey.xml";
			if ( file_exists( $cFileDB )  ) $oTab->addTab( $cKey, $cFileDB );
		}
	}
	function initializeAccion ( &$oInput , $cField = '' )
	{
		$oModule =& loadModule( "documentacion" );
		$oInput->addActionArray( 2, $oModule->getActionArray( AGREGAR_ACCION ) , "" );
		$oInput->addActionArray( 3, $oModule->getActionArray( MODIFICAR_ACCION ), "", $cField);
		$cSql	= "SELECT ncAccion, cdAccion FROM stAccion";
		$oInput->setMatrix( $oModule->oDatabase->getMatrix( $cSql )  );
		$oInput->setLabel('Accion', 'c');
		//$oInput->setFormName('frmDatos');
	}
	function initializeClase ( &$oInput )
	{
		$oModule =& loadModule( "documentacion" );
		$oInput->addActionArray( 2, $oModule->getActionArray( AGREGAR_CLASE ), "");
		$oInput->addActionArray( 3, $oModule->getActionArray( MODIFICAR_CLASE ), "" );
		$cSql = "SELECT ncClase, cFisico FROM stClase as Cla
											JOIN scTipoClase as TCl
												ON TCl.ncTipoClase = Cla.ncTipoClase";
		$cSql   .= armarFiltro ( "TCl.ncCategoriaClase", $ncCategoriaClase );
		$cSql   .= " Order BY cFisico";
		$oInput->setMatrix( $oModule->oDatabase->getMatrix( $cSql )  );
		//$oInput->setFormName('frmDatos');
		$oInput->setLabel('Clase', 'l');
	}
?>